﻿# CMakeList.txt: GAntUi 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)

# 如果支持，请为 MSVC 编译器启用热重载。
if (POLICY CMP0141)
  cmake_policy(SET CMP0141 NEW)
  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)

project ("GAntUi")

# 启用自动UI编译（AUTOUIC）
set(CMAKE_AUTOUIC ON)
# 启用自动元对象编译（AUTOMOC）
set(CMAKE_AUTOMOC ON)
# 启用自动资源编译（AUTORCC）
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(QT_PREFIX_PATH "D:/gaobo/Software/Qt/6.6.1/msvc2019_64")
set(CMAKE_PREFIX_PATH ${QT_PREFIX_PATH})

include_directories(
    ${QT_PREFIX_PATH}/include
    ${CMAKE_CURRENT_SOURCE_DIR}/GAntUi/include
    ${PROJECT_SOURCE_DIR}/GAntUi/include
)

# 将源代码添加到此项目的可执行文件。
add_executable (GAntUi "GAntUi/GAntUi.cpp" "GAntUi/GAntUi.h"  "GAntUi/include/FramelessWidget/frameless_widget.h" "GAntUi/src/FramelessWidget/frameless_widget.cpp" "GAntUi/include/gant_global_define.h")

find_package(Qt6 REQUIRED COMPONENTS Core Widgets Gui)

qt_standard_project_setup()

set_target_properties(GAntUi PROPERTIES    
    WIN32_EXECUTABLE TRUE
)

target_link_libraries(GAntUi PRIVATE
    Qt6::Core
    Qt6::Gui
    Qt6::Widgets
)

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})